<?php
/**
 * Created by PhpStorm.
 * User: zhongyb
 * Date: 2016/6/6
 * Time: 21:11
 */
namespace common\entities\common;

use common\entities\ConfigEntity;
use Yii;

/**
 * This is the model class for table "pigcms_users".
 *
 * @property integer $id
 * @property integer $inviter
 * @property integer $gid
 * @property string $username
 * @property string $mp
 * @property string $password
 * @property string $email
 * @property string $createtime
 * @property string $lasttime
 * @property string $status
 * @property string $createip
 * @property string $lastip
 * @property integer $diynum
 * @property integer $activitynum
 * @property integer $card_num
 * @property integer $card_create_status
 * @property integer $money
 * @property integer $moneybalance
 * @property integer $spend
 * @property string $viptime
 * @property integer $connectnum
 * @property integer $lastloginmonth
 * @property integer $attachmentsize
 * @property integer $wechat_card_num
 * @property integer $serviceUserNum
 * @property string $invitecode
 * @property string $db_host
 * @property string $db_port
 * @property string $db_name
 * @property string $db_user
 * @property integer $admin_uid
 * @property string $db_pwd
 * @property integer $is_admin
 * @property string $service_domain
 * @property string $auth_domian
 * @property string $company
 * @property string $encrypt_servurl
 * @property string $encrypt_username
 * @property string $encrypt_pwd
 * @property integer $encrypt_ishttps
 * @property string $CompanyXML
 * @property string $OrganizationId
 */
class PigcmsUsersEntity extends ConfigEntity
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return 'pigcms_users';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['inviter', 'gid', 'diynum', 'activitynum', 'card_num', 'card_create_status', 'money', 'moneybalance', 'spend', 'connectnum', 'lastloginmonth', 'attachmentsize', 'wechat_card_num', 'serviceUserNum', 'admin_uid', 'is_admin', 'encrypt_ishttps'], 'integer'],
            [['gid', 'username', 'password', 'email', 'createtime', 'lasttime', 'status', 'createip', 'lastip', 'diynum', 'activitynum', 'card_num', 'card_create_status', 'money', 'viptime', 'wechat_card_num', 'serviceUserNum'], 'required'],
            [['username'], 'string', 'max' => 60],
            [['mp'], 'string', 'max' => 11],
            [['password'], 'string', 'max' => 32],
            [['email'], 'string', 'max' => 90],
            [['createtime', 'lasttime', 'viptime'], 'string', 'max' => 13],
            [['status'], 'string', 'max' => 1],
            [['createip', 'lastip'], 'string', 'max' => 30],
            [['invitecode'], 'string', 'max' => 6],
            [['db_host', 'db_name', 'db_user', 'db_pwd', 'service_domain', 'auth_domian'], 'string', 'max' => 100],
            [['db_port'], 'string', 'max' => 5],
            [['company', 'encrypt_servurl', 'encrypt_username', 'encrypt_pwd'], 'string', 'max' => 200],
            [['CompanyXML'], 'string', 'max' => 256],
            [['OrganizationId'], 'string', 'max' => 36]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'inviter' => 'Inviter',
            'gid' => 'Gid',
            'username' => 'Username',
            'mp' => 'Mp',
            'password' => 'Password',
            'email' => 'Email',
            'createtime' => 'Createtime',
            'lasttime' => 'Lasttime',
            'status' => 'Status',
            'createip' => 'Createip',
            'lastip' => 'Lastip',
            'diynum' => 'Diynum',
            'activitynum' => 'Activitynum',
            'card_num' => 'Card Num',
            'card_create_status' => 'Card Create Status',
            'money' => 'Money',
            'moneybalance' => 'Moneybalance',
            'spend' => 'Spend',
            'viptime' => 'Viptime',
            'connectnum' => 'Connectnum',
            'lastloginmonth' => 'Lastloginmonth',
            'attachmentsize' => 'Attachmentsize',
            'wechat_card_num' => 'Wechat Card Num',
            'serviceUserNum' => 'Service User Num',
            'invitecode' => 'Invitecode',
            'db_host' => 'Db Host',
            'db_port' => 'Db Port',
            'db_name' => 'Db Name',
            'db_user' => 'Db User',
            'admin_uid' => 'Admin Uid',
            'db_pwd' => 'Db Pwd',
            'is_admin' => 'Is Admin',
            'service_domain' => 'Service Domain',
            'auth_domian' => 'Auth Domian',
            'company' => 'Company',
            'encrypt_servurl' => 'Encrypt Servurl',
            'encrypt_username' => 'Encrypt Username',
            'encrypt_pwd' => 'Encrypt Pwd',
            'encrypt_ishttps' => 'Encrypt Ishttps',
            'CompanyXML' => 'Company Xml',
            'OrganizationId' => 'Organization ID',
        ];
    }
}